package com.bang.daybreak.common.config;

import com.zaxxer.hikari.HikariDataSource;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @author : wdj
 * @since : 2019/1/6 0006 下午 15:48
 * @version 1.0
 */
@Component //在spirngboot 1.5+，原本的@ConfigurationProperties注解已将location属性移除，采用@Component的方式注册为组件。
@Data
@ConfigurationProperties(prefix = "spring.datasource.hikari")
@PropertySource("classpath:/application.yml") //指定自定义的资源目录
public class DBProperties {
    private HikariDataSource master;
    private HikariDataSource slave;

}
